import { defineStore } from "pinia";
import { ref } from "vue";
export const useStore = defineStore(
  "counter",
  () => {
    // 写数据的地方
    const count = ref(0);
    function changeCount() {
      count.value++;
    }
    // 最后导出
    return {
      count,
      changeCount,
    };
  },
  {
    persist: {
      enabled: true, //开启本地存储
    },
  }
);
